//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package SaveServlet.teacher;

import com.lyq.bean.Teacher;
import com.lyq.bean.service.T_Service;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

@WebServlet({"/TeacherInfo_Servlet"})
public class TeacherInfo_Servlet extends HttpServlet {
    private static final long serialVersionUID = 1L;

    public TeacherInfo_Servlet() {
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String id = request.getParameter("id");
        String No = (String)request.getSession().getAttribute("UNAME");
        List<Teacher> list = new ArrayList();
        list = (new T_Service()).seek_T("工号", "精确查询", No, list);
        Teacher t = (Teacher)list.toArray()[0];
        request.getSession().setAttribute("t", t);
        if (id.equals("info")) {
            request.getRequestDispatcher("/jsp/teacher/t/TeacherInfo.jsp").forward(request, response);
        } else if (id.equals("update")) {
            request.getRequestDispatcher("/jsp/teacher/t/UpdateTeacherInfo.jsp").forward(request, response);
        }

    }
}
